package com.ee.chat.common.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ee.chat.common.entity.UserConsumeLog;
import org.apache.ibatis.annotations.Param;

import java.util.Map;

/**
 * <p>
 * Mapper接口
 * </p>
 *
 * @author Shane
 * @since 2019-08-23
 */
public interface UserConsumeLogMapper extends BaseMapper<UserConsumeLog> {
    /**
     * 获取用户消费记录
     * @Author Shane
     * @Date 2019/8/26 23:24
     * @param
     * @return
     */
    IPage<Map<String, Object>> getConsumeLogByUserId(Page page, @Param("userId") Integer userId);

    /**
     * 根据消费id与消费类型查询
     * @Author Shane
     * @Date 2019/10/2920:07
     * @param
     * @return
     **/
    UserConsumeLog selectByBuyIdAndType(@Param("buyId") Integer buyId, @Param("type") Integer type);

    /**
     * 获取指定用户与指定主播之间的消费记录
     * @Author Shane
     * @Date 2020/1/28 14:29
     * @param
     * @return
     */
    int getConsumeLogCount(@Param("userId") Integer userId, @Param("toUserId") Integer toUserId);
}